package com.gitee.cirnochat.login.model.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.gitee.cirnochat.login.model.enums.QrCodeStatus;
import com.gitee.cirnochat.login.model.enums.QrCodeType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public abstract class AbstractQrCodeStatus {
    @Schema(description = "二维码ID")
    private String qrId;

    @Schema(description = "二维码状态", allowableValues = {"0:PENDING", "1:SCANNED", "2:EXPIRED", "3:SUCCESS"})
    private QrCodeStatus status;

    @Schema(description = "二维码类型", allowableValues = {"0:LOGIN"})
    private QrCodeType type;

    @Schema(description = "设备信息")
    private DeviceInfo device;

    @Schema(description = "二维码生成时间戳")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long createTime;

    @Schema(description = "二维码过期时间戳")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long expireTime;

    public AbstractQrCodeStatus(String qrId, QrCodeStatus status,QrCodeType type) {
        this.qrId = qrId;
        this.status = status;
        this.type = type;
    }
}
